#include "../../include/server_handle.h"
/***************************************************
函数名:server_reg
功能:客户端注册处理
传入参数:struct message *a, clientinf *clientNode
返回值:无
***************************************************/
int server_reg(struct message *a, clientinf *clientNode)
{
    int i;
	char buf[MAXLEN];
    i = reg_check(a);
    if(i == 1)
    {
	    printf("%s 注册成功!\n",(*a).name);
   	    my_strcpy((*a).msg,"register,success!");
	    my_strcpy((*clientNode).name,(*a).name);
	    my_send((*clientNode).decr,a,sizeof(struct message),0);
    }
    else
    {
	    printf("%s 注册失败!\n",(*a).name);
	    my_strcpy((*a).msg,"register,failure!");
	    my_send((*clientNode).decr,a,sizeof(struct message),0);
    }
}

